package com.rmondjone.androidcamerademo

import android.graphics.Color
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.rmondjone.androidcamerademo.bean.FaceBean

/**
 * copyright：
 * @author：anthui creation date： .
 * @since: 1.0.0
 * @describe:List<ApdataBean>
 */
class FaceAdapter : BaseQuickAdapter<FaceBean.ApdataBean, BaseViewHolder>(R.layout.item_list_face) {
    override fun convert(helper: BaseViewHolder, item: FaceBean.ApdataBean) {
        helper.setText(R.id.tv_content, item.name)

        var view = helper.getView<TextView>(R.id.tv_content)

        if (item.isCheck) {

            view.setBackgroundResource(R.drawable.select_face_select)
            view.setTextColor(Color.WHITE)
        } else {
            view.setTextColor(Color.parseColor("#BE9B6D"))
            view.setBackgroundResource(R.drawable.select_face)

        }

    }

}